Closed
Bug 1661527
Opened 5 years ago
Closed 5 years ago
ThreadSanitizer: data race during async dns resolve
Categories
(Core :: Networking: DNS, defect, P2)
Core
Networking: DNS
Tracking
()
RESOLVED
FIXED
82 Branch
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: froydnj, Assigned: kershaw)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
This one popped up on treeherder for me. Stacks:
==================
WARNING: ThreadSanitizer: data race (pid=18826)
Write of size 8 at 0x7b60000b53a0 by thread T4:
#0 assign_assuming_AddRef /builds/worker/workspace/obj-build/dist/include/nsCOMPtr.h:361:13 (libxul.so+0x121c592)
#1 assign_assuming_AddRef /builds/worker/workspace/obj-build/dist/include/nsCOMPtr.h:388:20 (libxul.so+0x121c592)
#2 operator= /builds/worker/workspace/obj-build/dist/include/nsCOMPtr.h:684:5 (libxul.so+0x121c592)
#3 mozilla::net::nsHttpTransaction::OnLookupComplete(nsICancelable*, nsIDNSRecord*, nsresult) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpTransaction.cpp:2702:15 (libxul.so+0x121c592)
#4 non-virtual thunk to mozilla::net::nsHttpTransaction::OnLookupComplete(nsICancelable*, nsIDNSRecord*, nsresult) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpTransaction.cpp (libxul.so+0x121c9f8)
#5 operator() /builds/worker/checkouts/gecko/netwerk/dns/DNSListenerProxy.cpp:29:59 (libxul.so+0xd57713)
#6 mozilla::detail::RunnableFunction<mozilla::net::DNSListenerProxy::OnLookupComplete(nsICancelable*, nsIDNSRecord*, nsresult)::$_2>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:577:5 (libxul.so+0xd57713)
#7 nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1242:14 (libxul.so+0xb2ce9b)
#8 NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:513:10 (libxul.so+0xb320e2)
#9 mozilla::net::nsSocketTransportService::Run() /builds/worker/checkouts/gecko/netwerk/base/nsSocketTransportService2.cpp:1195:11 (libxul.so+0xcc7ec7)
#10 non-virtual thunk to mozilla::net::nsSocketTransportService::Run() /builds/worker/checkouts/gecko/netwerk/base/nsSocketTransportService2.cpp (libxul.so+0xcc9369)
#11 nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1242:14 (libxul.so+0xb2ce9b)
#12 NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:513:10 (libxul.so+0xb320e2)
#13 mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) /builds/worker/checkouts/gecko/ipc/glue/MessagePump.cpp:302:20 (libxul.so+0x141e56e)
#14 RunInternal /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:334:10 (libxul.so+0x13ad11c)
#15 RunHandler /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:327:3 (libxul.so+0x13ad11c)
#16 MessageLoop::Run() /builds/worker/checkouts/gecko/ipc/chromium/src/base/message_loop.cc:309:3 (libxul.so+0x13ad11c)
#17 nsThread::ThreadFunc(void*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:450:10 (libxul.so+0xb2900a)
#18 _pt_root /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:201:5 (libnspr4.so+0x44daf)
Previous write of size 8 at 0x7b60000b53a0 by main thread (mutexes: write M530153119292856368):
#0 forget<nsICancelable> /builds/worker/workspace/obj-build/dist/include/mozilla/RefPtr.h:270:11 (libxul.so+0xd5f631)
#1 nsDNSService::AsyncResolveInternal(nsTSubstring<char> const&, unsigned short, unsigned int, nsIDNSResolverInfo*, nsIDNSListener*, nsIEventTarget*, mozilla::OriginAttributes const&, nsICancelable**) /builds/worker/checkouts/gecko/netwerk/dns/nsDNSService2.cpp:967:7 (libxul.so+0xd5f631)
#2 nsDNSService::AsyncResolveNative(nsTSubstring<char> const&, nsIDNSService::ResolveType, unsigned int, nsIDNSResolverInfo*, nsIDNSListener*, nsIEventTarget*, mozilla::OriginAttributes const&, nsICancelable**) /builds/worker/checkouts/gecko/netwerk/dns/nsDNSService2.cpp:1033:10 (libxul.so+0xd5ffd3)
#3 mozilla::net::nsHttpTransaction::Init(unsigned int, mozilla::net::nsHttpConnectionInfo*, mozilla::net::nsHttpRequestHead*, nsIInputStream*, unsigned long, bool, nsIEventTarget*, nsIInterfaceRequestor*, nsITransportEventSink*, unsigned long, mozilla::net::HttpTrafficCategory, nsIRequestContext*, unsigned int, unsigned int, bool, unsigned long, std::function<void (mozilla::net::TransactionObserverResult&&)>&&, std::function<nsresult (unsigned int, nsTSubstring<char> const&, nsTSubstring<char> const&, mozilla::net::HttpTransactionShell*)>&&, mozilla::net::HttpTransactionShell*, unsigned int) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpTransaction.cpp:442:17 (libxul.so+0x121264a)
#4 non-virtual thunk to mozilla::net::nsHttpTransaction::Init(unsigned int, mozilla::net::nsHttpConnectionInfo*, mozilla::net::nsHttpRequestHead*, nsIInputStream*, unsigned long, bool, nsIEventTarget*, nsIInterfaceRequestor*, nsITransportEventSink*, unsigned long, mozilla::net::HttpTrafficCategory, nsIRequestContext*, unsigned int, unsigned int, bool, unsigned long, std::function<void (mozilla::net::TransactionObserverResult&&)>&&, std::function<nsresult (unsigned int, nsTSubstring<char> const&, nsTSubstring<char> const&, mozilla::net::HttpTransactionShell*)>&&, mozilla::net::HttpTransactionShell*, unsigned int) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpTransaction.cpp (libxul.so+0x1212b79)
#5 mozilla::net::nsHttpChannel::SetupTransaction() /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:1463:22 (libxul.so+0x119fcf4)
#6 mozilla::net::nsHttpChannel::DoConnectActual(mozilla::net::HttpTransactionShell*) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:974:17 (libxul.so+0x119e5d2)
#7 mozilla::net::nsHttpChannel::DoConnect(mozilla::net::HttpTransactionShell*) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:966:10 (libxul.so+0x119e44e)
#8 mozilla::net::nsHttpChannel::ContinueConnect() /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:930:10 (libxul.so+0x119c560)
#9 mozilla::net::nsHttpChannel::TriggerNetwork() /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:10046:10 (libxul.so+0x119db6b)
#10 mozilla::net::nsHttpChannel::OnCacheEntryAvailableInternal(nsICacheEntry*, bool, nsIApplicationCache*, nsresult) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:4801:10 (libxul.so+0x11b5630)
#11 mozilla::net::nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry*, bool, nsIApplicationCache*, nsresult) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:4714:8 (libxul.so+0x11b5184)
#12 non-virtual thunk to mozilla::net::nsHttpChannel::OnCacheEntryAvailable(nsICacheEntry*, bool, nsIApplicationCache*, nsresult) /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp (libxul.so+0x11b576b)
#13 mozilla::net::CacheEntry::InvokeAvailableCallback(mozilla::net::CacheEntry::Callback const&) /builds/worker/checkouts/gecko/netwerk/cache2/CacheEntry.cpp:892:29 (libxul.so+0xfc2c2a)
#14 mozilla::net::CacheEntry::AvailableCallbackRunnable::Run() /builds/worker/checkouts/gecko/netwerk/cache2/CacheEntry.h:228:15 (libxul.so+0x101d683)
#15 mozilla::RunnableTask::Run() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:242:16 (libxul.so+0xb161b7)
#16 mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:512:26 (libxul.so+0xb139f5)
#17 mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:371:15 (libxul.so+0xb12596)
#18 mozilla::TaskController::ProcessPendingMTTask(bool) /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:168:36 (libxul.so+0xb12834)
#19 operator() /builds/worker/checkouts/gecko/xpcom/threads/TaskController.cpp:86:37 (libxul.so+0xb19e87)
#20 mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_5>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:577:5 (libxul.so+0xb19e87)
#21 nsThread::ProcessNextEvent(bool, bool*) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:1242:14 (libxul.so+0xb2cc30)
#22 NS_ProcessNextEvent(nsIThread*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:513:10 (libxul.so+0xb320e2)
#23 SpinEventLoopUntil<mozilla::ProcessFailureBehavior::ReportToCaller, (lambda at /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:702:36)> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:362:25 (libxul.so+0xb31b62)
#24 nsThreadManager::SpinEventLoopUntilInternal(nsINestedEventLoopCondition*, bool) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:702:8 (libxul.so+0xb31b62)
#25 nsThreadManager::SpinEventLoopUntil(nsINestedEventLoopCondition*) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:681:10 (libxul.so+0xb319e7)
#26 NS_InvokeByIndex /builds/worker/checkouts/gecko/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S:101 (libxul.so+0xb50d15)
#27 XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) /builds/worker/checkouts/gecko/js/xpconnect/src/XPCWrappedNativeJSOps.cpp:946:10 (libxul.so+0x1a3f501)
#28 CallJSNative /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:507:13 (libxul.so+0x67b8479)
#29 js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:599:12 (libxul.so+0x67b8479)
#30 InternalCall /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:664:10 (libxul.so+0x67ae1ab)
#31 CallFromStack /builds/worker/checkouts/gecko/js/src/vm/Interpreter.cpp:668:10 (libxul.so+0x67ae1ab)
#45 mozilla::BootstrapImpl::XRE_XPCShellMain(int, char**, char**, XREShellData const*) /builds/worker/checkouts/gecko/toolkit/xre/Bootstrap.cpp:54:12 (libxul.so+0x668e3db)
#46 main /builds/worker/checkouts/gecko/js/xpconnect/shell/xpcshell.cpp:66:27 (xpcshell+0xc9be6)
Mutex M530153119292856368 is already destroyed.
Thread T4 'Socket Thread' (tid=18831, running) created by main thread at:
#0 pthread_create /builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:967:3 (xpcshell+0x5848b)
#1 _PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:458:14 (libnspr4.so+0x3bfb3)
#2 PR_CreateThread /builds/worker/checkouts/gecko/nsprpub/pr/src/pthreads/ptthread.c:533:12 (libnspr4.so+0x308e2)
#3 nsThread::Init(nsTSubstring<char> const&) /builds/worker/checkouts/gecko/xpcom/threads/nsThread.cpp:667:8 (libxul.so+0xb2a5ce)
#4 nsThreadManager::NewNamedThread(nsTSubstring<char> const&, unsigned int, nsIThread**) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadManager.cpp:629:12 (libxul.so+0xb317da)
#5 NS_NewNamedThread(nsTSubstring<char> const&, nsIThread**, already_AddRefed<nsIRunnable>, unsigned int) /builds/worker/checkouts/gecko/xpcom/threads/nsThreadUtils.cpp:161:57 (libxul.so+0xb37dc8)
#6 NS_NewNamedThread<14> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:85:10 (libxul.so+0xcc67da)
#7 mozilla::net::nsSocketTransportService::Init() /builds/worker/checkouts/gecko/netwerk/base/nsSocketTransportService2.cpp:775:7 (libxul.so+0xcc67da)
#8 mozilla::xpcom::CreateInstanceImpl(mozilla::xpcom::ModuleID, nsISupports*, nsID const&, void**) /builds/worker/workspace/obj-build/xpcom/components/StaticComponents.cpp:11896:7 (libxul.so+0xaf39b8)
#9 mozilla::xpcom::StaticModule::CreateInstance(nsISupports*, nsID const&, void**) const /builds/worker/workspace/obj-build/xpcom/components/StaticComponents.cpp:12188:10 (libxul.so+0xaeb150)
#10 CreateInstance /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:219:46 (libxul.so+0xb01dd5)
#11 nsComponentManagerImpl::GetServiceLocked((anonymous namespace)::MutexLock&, (anonymous namespace)::EntryWrapper&, nsID const&, void**) /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:1370:17 (libxul.so+0xb01dd5)
#12 nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**) /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:1555:10 (libxul.so+0xafcd03)
#13 CallGetService /builds/worker/checkouts/gecko/xpcom/components/nsComponentManagerUtils.cpp:61:43 (libxul.so+0xb052fa)
#14 nsGetServiceByContractIDWithError::operator()(nsID const&, void**) const /builds/worker/checkouts/gecko/xpcom/components/nsComponentManagerUtils.cpp:253:21 (libxul.so+0xb052fa)
#15 nsCOMPtr_base::assign_from_gs_contractid_with_error(nsGetServiceByContractIDWithError const&, nsID const&) /builds/worker/checkouts/gecko/xpcom/base/nsCOMPtr.cpp:91:7 (libxul.so+0xa4a877)
#16 operator= /builds/worker/workspace/obj-build/dist/include/nsCOMPtr.h:762:5 (libxul.so+0xc6cfa1)
#17 InitializeSocketTransportService /builds/worker/checkouts/gecko/netwerk/base/nsIOService.cpp:424:29 (libxul.so+0xc6cfa1)
#18 mozilla::net::nsIOService::SetOffline(bool) /builds/worker/checkouts/gecko/netwerk/base/nsIOService.cpp:1295:7 (libxul.so+0xc6cfa1)
#19 mozilla::net::nsIOService::Init() /builds/worker/checkouts/gecko/netwerk/base/nsIOService.cpp:307:3 (libxul.so+0xc6c300)
#20 mozilla::net::nsIOService::GetInstance() /builds/worker/checkouts/gecko/netwerk/base/nsIOService.cpp:481:9 (libxul.so+0xc6de41)
#21 mozilla::xpcom::CreateInstanceImpl(mozilla::xpcom::ModuleID, nsISupports*, nsID const&, void**) /builds/worker/workspace/obj-build/xpcom/components/StaticComponents.cpp:11744:48 (libxul.so+0xaf3595)
#22 mozilla::xpcom::StaticModule::CreateInstance(nsISupports*, nsID const&, void**) const /builds/worker/workspace/obj-build/xpcom/components/StaticComponents.cpp:12188:10 (libxul.so+0xaeb150)
#23 CreateInstance /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:219:46 (libxul.so+0xb01dd5)
#24 nsComponentManagerImpl::GetServiceLocked((anonymous namespace)::MutexLock&, (anonymous namespace)::EntryWrapper&, nsID const&, void**) /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:1370:17 (libxul.so+0xb01dd5)
#25 nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**) /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:1555:10 (libxul.so+0xafcd03)
#26 CallGetService(char const*, nsID const&, void**) /builds/worker/checkouts/gecko/xpcom/components/nsComponentManagerUtils.cpp:61:43 (libxul.so+0xb04e0d)
#27 CallGetService<nsIIOService> /builds/worker/workspace/obj-build/dist/include/nsServiceManagerUtils.h:72:10 (libxul.so+0x1d1ee53)
#28 nsScriptSecurityManager::Init() /builds/worker/checkouts/gecko/caps/nsScriptSecurityManager.cpp:1375:17 (libxul.so+0x1d1ee53)
#29 nsScriptSecurityManager::InitStatics() /builds/worker/checkouts/gecko/caps/nsScriptSecurityManager.cpp:1436:28 (libxul.so+0x1d1f71e)
#30 nsXPConnect::InitStatics() /builds/worker/checkouts/gecko/js/xpconnect/src/nsXPConnect.cpp:150:3 (libxul.so+0x1a45df0)
#31 xpcModuleCtor() /builds/worker/checkouts/gecko/js/xpconnect/src/XPCModule.cpp:11:3 (libxul.so+0x1a1a47f)
#32 nsLayoutModuleInitialize() /builds/worker/checkouts/gecko/layout/build/nsLayoutModule.cpp:108:7 (libxul.so+0x51f13a7)
#33 nsComponentManagerImpl::Init() /builds/worker/checkouts/gecko/xpcom/components/nsComponentManager.cpp:484:5 (libxul.so+0xafd801)
#34 NS_InitXPCOM /builds/worker/checkouts/gecko/xpcom/build/XPCOMInit.cpp:447:51 (libxul.so+0xb64ac6)
#35 XRE_XPCShellMain(int, char**, char**, XREShellData const*) /builds/worker/checkouts/gecko/js/xpconnect/src/XPCShellImpl.cpp:1197:10 (libxul.so+0x1a2aef2)
#36 mozilla::BootstrapImpl::XRE_XPCShellMain(int, char**, char**, XREShellData const*) /builds/worker/checkouts/gecko/toolkit/xre/Bootstrap.cpp:54:12 (libxul.so+0x668e3db)
#37 main /builds/worker/checkouts/gecko/js/xpconnect/shell/xpcshell.cpp:66:27 (xpcshell+0xc9be6)
This is based off of hg revision 63d860f118da09320ed65431129775b4e3631ff3.
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → kershaw
Severity: -- → S4
Priority: -- → P2
Whiteboard: [necko-triaged]
Assignee | ||
Comment 1•5 years ago
|
||
Pushed by kjang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a3967061a7cf
Avoid data race on nsHttpTransaction::mDNSRequest r=valentin
Comment 4•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox82:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Comment hidden (Intermittent Failures Robot) |
Comment hidden (Intermittent Failures Robot) |
You need to log in
before you can comment on or make changes to this bug.
Description
•